<div class="edit">
	<form action="<?php echo url('news/edit');?>" method="post" id="editForm">
		<table>
			<tr>
				<td width="80" class="inputtxt" align="right"><span>文章标题</span></td>
				<td align="left">
					<input type="text" class="required" name="news[title]" value="<?php echo $news['title']?>" />
					<span style="color:red;">*</span>
				</td>
			</tr>
			<tr>
				<td class="inputtxt" align="right"><span>文章分类</span></td>
				<td align="left"><?php echo fetch('categorySelect',array('name'=>'news[categoryID]','parentID'=>$news['categoryID'],'type'=>service_type::NEWS));?></td>
			</tr>
			<tr>
				<td class="inputtxt" align="right"><span>文章图片</span></td>
				<td align="left">
					<?php echo fetch('uploadImg',array('images'=>$images,'limit'=>1,'picType'=>service_type::NEWS));?>
				</td>
			</tr>
			<tr>
				<td class="inputtxt" align="right"><span>排序</span></td>
				<td align="left"><input type="text" name="news[sortID]" value="<?php echo $news['sortID']?>"/></td></tr>
			<tr>

			<tr>
				<td class="inputtxt" align="right"><span>文章摘要</span></td>
				<td align="left"><textarea name="news[description]" cols="100" rows="4"><?php echo $news['description'];?></textarea></td>
			</tr>
			<tr>
				<td class="inputtxt" align="right"><span>文章内容</span></td>
				<td align="left"><textarea id="ckeditor" name="news[content]"><?php echo $news['content'];?></textarea></td>
			</tr>
			<tr><td colspan="2" align="right"><input type="submit" value="修改" onClick="CKupdate();" id="catesub" /></td></tr>
		</table>
                <input type="hidden" name="id" value="<?php echo $news['id'];?>" />
	</form>
</div>
<script type="text/javascript">
$(document).ready(function(){
	CKEDITOR.replace('ckeditor',{
		filebrowserImageUploadUrl:"/admin.php/image/ckUpload.html",
	});
	submitForm("#editForm",{
		dataType:'json',
		success:function(data){
				if(data.i=='ok'){
					location.href="<?php echo url('news/index');?>";
				}else{
					alert(data.i);
				}
			},
	});
});
</script>
